<!--
 * @Author: 吴竹叶 2107206923@qq.com
 * @Date: 2023-09-27 15:22:32
 * @LastEditors: 胡威 3749920422@qq.com
 * @LastEditTime: 2024-03-19 15:11:13
 * @FilePath: \BZ_JT_AnQuanHuanBaoGuanLiApp\src\views\staging\commom\evaluate\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="common-details">
    <customDetailsTopbar :title="title" :show-right-icon="true" flag @back="back">
      <template #right>
        <div class="icon-box">
          <i class="iconfont mr-1" :class="{ active: active }" @click="active = !active">&#xe611;</i>
          <i class="iconfont" :class="{ active: !active }" @click="active = !active">&#xe651;</i>
        </div>
      </template>
    </customDetailsTopbar>
    <div id="customScroolBox" class="d-scroll px-1">
      <List v-if="active" :company-id="companyId" />
      <Chart v-else :company-id="companyId" />
    </div>
  </div>
</template>
<script>
import List from './components/list.vue'
import Chart from './components/chart.vue'
import commonList from '@/assets/mixin/commonList'
export default {
  components: {
    List,
    Chart
  },
  mixins: [commonList],
  data() {
    return {
      active: true,
      title: '',
      companyId: '',
      current: ''
    }
  },
  created() {
    const { current, companyId } = this.$route.query
    this.companyId = companyId || ''
    this.current = current || ''
  },
  mounted() {
    this.title = this.current.substring(0, 2) + '智能综合评价'
  },
  methods: {
    // 返回工作台
    back() {
      this.$router.push({
        path: '/staging/monitor',
        query: { current: this.current }
      })
    }
  }
}
</script>
<style lang="scss">
.iconfont.active {
  color: #64ebfb;
}
</style>
